#ifndef SERVERMAINWINDOW_H
#define SERVERMAINWINDOW_H

#include <QMainWindow>
#include <softwarestatus.h>
#include <QDateTime>
#include <QSettings>
#include <QMessageBox>
#include <QTcpServer>
#include <QTcpSocket>
#include <QNetworkProxyFactory>
#include "ipset.h"

QT_BEGIN_NAMESPACE
namespace Ui { class ServerMainwindow; }
QT_END_NAMESPACE

class ServerMainwindow : public QMainWindow
{
    Q_OBJECT

public:
    ServerMainwindow(QWidget *parent = nullptr);
    ~ServerMainwindow();

    void f_UpdateUI();
    void f_SetIPAddress(QString IP);
    void f_SetPort(QString Port);
    void f_StartTCP();

signals:
    void signal_status_changed(int);

private slots:
    void on_ui_BtnCleanBash_clicked();

    void on_action_IP_I_triggered();

    void on_ui_BtnChangeIP_clicked();

    void slot_AcceptConnection();

    void slot_AcceptData();

private:
    Ui::ServerMainwindow *ui;
    QTcpServer *m_server;
    QTcpSocket *m_socket = nullptr;

    QString m_IP = "0.0.0.0";
    QString m_Port = "0000";
    QString m_PeerIP = "0.0.0.0";
    QString m_PeerPort = "0000";
};
#endif // SERVERMAINWINDOW_H
